<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Gloze: attribute</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />



</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Gloze
   &#160;<span id="projectnumber">1.01-beta2</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="namespaces.html"><span>Packages</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
    </ul>
  </div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="components.html">Schema Components</a>      </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="headertitle">
<div class="title">attribute </div>  </div>
</div>
<div class="contents">
<div class="textblock"><p>Attributes map to RDF properties. An instance of an attribute maps to an RDF statement. A qualified attribute is defined in the target namespace of the schema. The target namespace is the namespace of the corresponding RDF property.</p>
<p>e.g. The following schema declares a global and therefore qualified attribute 'foo' defined in the target namespace.</p>
<div class="fragment"><pre class="fragment">&lt;?xml version=<span class="stringliteral">&quot;1.0&quot;</span> encoding=<span class="stringliteral">&quot;UTF-8&quot;</span>?&gt;
&lt;xs:schema xmlns:xs=<span class="stringliteral">&quot;http://www.w3.org/2001/XMLSchema&quot;</span> 
        targetNamespace=<span class="stringliteral">&quot;http://example.org/&quot;</span> xmlns=<span class="stringliteral">&quot;http://example.org/&quot;</span>&gt;
        &lt;xs:attribute name=<span class="stringliteral">&quot;foo&quot;</span> /&gt;
&lt;/xs:schema&gt;
</pre></div><p>By default, we take the closure over global attributes, assuming that <em>all</em> uses of the property conform to this global declaration. This means that 'foo' globally ranges over rdfs:Literal (the datatype corresponding to xs:anySimpleType). If this assumption is false, attribute closure may be disabled (closed=false), and global ranges are not asserted.</p>
<div class="fragment"><pre class="fragment">@prefix ns2:     &lt;http:<span class="comment">//example.org/def/&gt; .</span>
@prefix rdfs:    &lt;http:<span class="comment">//www.w3.org/2000/01/rdf-schema#&gt; .</span>
@prefix ns1:     &lt;http:<span class="comment">//example.org/&gt; .</span>
@prefix xs_:     &lt;http:<span class="comment">//www.w3.org/2001/XMLSchema#&gt; .</span>
@prefix owl:     &lt;http:<span class="comment">//www.w3.org/2002/07/owl#&gt; .</span>
@prefix xsd:     &lt;http:<span class="comment">//www.w3.org/2001/XMLSchema#&gt; .</span>
@prefix rdf:     &lt;http:<span class="comment">//www.w3.org/1999/02/22-rdf-syntax-ns#&gt; .</span>
@prefix xs:      &lt;http:<span class="comment">//www.w3.org/2001/XMLSchema&gt; .</span>

&lt;http:<span class="comment">//example.org/attribute1.owl&gt;</span>
      a       owl:Ontology .

ns1:foo
      a       rdf:Property , owl:DatatypeProperty ;
      rdfs:range rdfs:Literal .
</pre></div><p>Like elements, if the target namespace ends with an alpha-numeric a fragment separator '#' is introduced.</p>
<p>Unqualified attributes are not defined in the target namespace. Unqualified attributes occur if no target namespace is defined, or where the attribute is defined locally and its form is unqualified. The example below defines the attribute 'foo' locally within an attributeGroup; it's form is unqualified by default.</p>
<div class="fragment"><pre class="fragment">&lt;?xml version=<span class="stringliteral">&quot;1.0&quot;</span> encoding=<span class="stringliteral">&quot;UTF-8&quot;</span>?&gt;
&lt;xs:schema xmlns:xs=<span class="stringliteral">&quot;http://www.w3.org/2001/XMLSchema&quot;</span> targetNamespace=<span class="stringliteral">&quot;http://example.org/&quot;</span>&gt;
        &lt;xs:attributeGroup name=<span class="stringliteral">&quot;myGroup&quot;</span>&gt;
                &lt;xs:attribute name=<span class="stringliteral">&quot;foo&quot;</span>/&gt;
        &lt;/xs:attributeGroup&gt;
&lt;/xs:schema&gt;
</pre></div><p>All we can say about the attribute is that it is a property, for the same name may be re-used where its range is a different datatype or even an object type. Closure doesn't apply to local attributes.</p>
<p>The following OWL was produced with lang=N3. The unqualified attribute is defined in the user-supplied default namespace, with xmlns=<a href="http://example.org/def/">http://example.org/def/</a> .</p>
<div class="fragment"><pre class="fragment">@prefix ns2:     &lt;http:<span class="comment">//example.org/&gt; .</span>
@prefix rdfs:    &lt;http:<span class="comment">//www.w3.org/2000/01/rdf-schema#&gt; .</span>
@prefix ns1:     &lt;http:<span class="comment">//example.org/def/&gt; .</span>
@prefix xs_:     &lt;http:<span class="comment">//www.w3.org/2001/XMLSchema#&gt; .</span>
@prefix owl:     &lt;http:<span class="comment">//www.w3.org/2002/07/owl#&gt; .</span>
@prefix xsd:     &lt;http:<span class="comment">//www.w3.org/2001/XMLSchema#&gt; .</span>
@prefix rdf:     &lt;http:<span class="comment">//www.w3.org/1999/02/22-rdf-syntax-ns#&gt; .</span>
@prefix xs:      &lt;http:<span class="comment">//www.w3.org/2001/XMLSchema&gt; .</span>

ns1:foo
      a       rdf:Property , owl:DatatypeProperty .

&lt;http:<span class="comment">//example.org/attribute2.owl&gt;</span>
      a       owl:Ontology .
</pre></div><p>In xml schema, attributes have their own symbol space, distinct from other components such as elements and types. If there are overlaps between these symbol spaces, it is advisable to introduce a symbolic prefix to keep them distinct.</p>
<p>e.g. the attribute named 'foo' and type named 'foo' in the target namespace <a href="http://example.org/">http://example.org/</a> will clash. Introducing a symbolic prefix '@' (at the command line) for attributes resolves the clash giving us an RDF property name <a href="http://example.org/@foo.">http://example.org/@foo.</a></p>
<p>The OWL mapping below was generated from the first schema above, but with attribute=@</p>
<div class="fragment"><pre class="fragment">@prefix ns2:     &lt;http:<span class="comment">//example.org/def/&gt; .</span>
@prefix rdfs:    &lt;http:<span class="comment">//www.w3.org/2000/01/rdf-schema#&gt; .</span>
@prefix ns1:     &lt;http:<span class="comment">//example.org/&gt; .</span>
@prefix xs_:     &lt;http:<span class="comment">//www.w3.org/2001/XMLSchema#&gt; .</span>
@prefix owl:     &lt;http:<span class="comment">//www.w3.org/2002/07/owl#&gt; .</span>
@prefix xsd:     &lt;http:<span class="comment">//www.w3.org/2001/XMLSchema#&gt; .</span>
@prefix rdf:     &lt;http:<span class="comment">//www.w3.org/1999/02/22-rdf-syntax-ns#&gt; .</span>
@prefix xs:      &lt;http:<span class="comment">//www.w3.org/2001/XMLSchema&gt; .</span>

&lt;http:<span class="comment">//example.org/@foo&gt;</span>
      a       rdf:Property , owl:DatatypeProperty ;
      rdfs:range rdfs:Literal .

&lt;http:<span class="comment">//example.org/attribute3.owl&gt;</span>
      a       owl:Ontology .
</pre></div><h2><a class="anchor" id="attributeChildren"></a>
Child components</h2>
<ul>
<li><a class="el" href="simple_type.html">simpleType</a></li>
<li><a class="el" href="annotation.html">annotation</a> </li>
</ul>
</div></div>


<hr class="footer"/><address class="footer"><small>
Generated on Tue Nov 15 2011 22:13:50 for Gloze by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.5.1
</small></address>

</body>
</html>
